<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/Global.js"></script>
    <style>
        .wrap {
            padding: 20px;
            width: 100%;
            overflow: auto;
            box-sizing: border-box;
        }

        ul {
            width: 100%;
        }

        ul li {
            width: 25%;
            float: left;
            height: 36px;
            line-height: 36px;
            /* background: #ccc; */
            text-align: center;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-top: 0px;
            cursor: pointer;
        }

        ul li:first-of-type {
            border: 1px solid #ccc;
        }

        ul li:nth-of-type(2) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        ul li:nth-of-type(3) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        ul li:nth-of-type(4) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        .winbody {
            width: 720px;
            padding: 10px;
        }

        .carlist {
            width: 120px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 14px;
            display: inline-block;
        }

        .tabs {
            /* width: 900px; */
        }

        .tabs a {
            width: 120px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 14px;
            display: inline-block;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <ul id="list">
            <li onclick="seeInfo()">
                <a>
                    天津港保税区金方舟贸易有限公司
                </a>
            </li>
            <li>
                <a href="">
                    天津港保税区金方舟贸易有限公司
                </a>
            </li>
            <li>
                <a href="">
                    天津港保税区金方舟贸易有限公司
                </a>
            </li>
            <li>
                <a href="">
                    天津港保税区金方舟贸易有限公司
                </a>
            </li>
            <li>
                <a href="">
                    天津港保税区金方舟贸易有限公司
                </a>
            </li>
        </ul>
    </div>
    <div class="winbody" style="display:none;">
        <div class="lists">
            <a href="./luntaizhuangtaixiangqing.html" class="carlist">津KYD178(001)</a>
            <a href="" class="carlist">津KYD178(001)</a>
            <a href="" class="carlist">津KYD178(001)</a>
            <a href="" class="carlist">津KYD178(001)</a>
        </div>
    </div>
</body>
<script>
   var cokeid = 1;

	 

		function seeInfo(id) {

			$.ajax({
				url: API+'/erpManagement/gojianceweihuCar?custId=' + id,
				type: 'get',
				dataType: 'json',
				success: function(ret) {
					var objkacha = ret.data.putongche
					var objdagua = ret.data.guache;
					var html = '';

					for(var key in objkacha) {
						html += '<a href="luntaizhuangtaixiangqing.html?userid='+cokeid+'&id=' + encodeURI(encodeURI(objkacha[key].carPlate)) + '" class="carlist">' + objkacha[key].carPlate + '</a>';
					}
					for(var key in objdagua) {
						html += '<a href="luntaizhuangtaixiangqing.html?userid='+cokeid+'&id=' + encodeURI(encodeURI(objdagua[key].carPlate)) + '" class="carlist">' + objdagua[key].carPlate + '</a>';
					}
					$(".lists").html(html);
				},
				error: function(err) {
					alert("系统错误");
				}
			});
			layui.use('layer', function() {
				let layer = layui.layer;
				layer.open({
					type: 1,
					area: ['740px', '200px'],
					title: '车辆牌号',
					content: $('.winbody')
				});
			})
		}
		$(function() {

			$.ajax({
				url: API+'/erpManagement/gojianceweihu?custId=' + cokeid,
				type: 'get',
				dataType: 'json',
				success: function(ret) {
					var obj = ret.data
					var html = '';

					for(var key in obj) {
						html += '<li onclick="seeInfo(' + obj[key].id + ')">' +
							'<a>' +
							'' + obj[key].cusName + '' +
							'</a>' +
							'</li>';
					}
					$("#list").html(html);
				},
				error: function(err) {
					alert("系统错误");

				}
			});

		})
</script>